//
//  ICMessageDrtNewsCell.m
//  ICome
//
//  Created by zhangrongwu on 2017/7/13.
//  Copyright © 2017年 iCom. All rights reserved.
//

#import "ICMessageDrtNewsCell.h"
#import "ICDrtNewsButton.h"

@interface ICMessageDrtNewsCell()

@property (nonatomic, strong) ICDrtNewsButton *shareButton;

@end

@implementation ICMessageDrtNewsCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.shareButton];
    }
    return self;
}



- (void)setModelFrame:(ICMessageFrame *)modelFrame
{
    [super setModelFrame:modelFrame];
    
    self.shareButton.frame = modelFrame.picViewF;
    self.shareButton.messageModel = modelFrame.model;
}

#pragma mark - Event

- (void)shareBtnClicked
{
    [self routerEventWithName:GXRouterEventDrtNewsTapEvent
                     userInfo:@{TypeDrtNews : self.modelFrame}];
}

#pragma mark - Getter

- (ICDrtNewsButton *)shareButton
{
    if (!_shareButton) {
        _shareButton = [ICDrtNewsButton buttonWithType:UIButtonTypeCustom];
        [_shareButton addTarget:self action:@selector(shareBtnClicked) forControlEvents:UIControlEventTouchUpInside];
    }
    return _shareButton;
}



@end
